import time

# 方法1
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.common.by import By

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

wd = webdriver.Chrome(service=Service(".\chromedriver_win136.exe"))
wd.get("https://pvp.qq.com/web201605/herolist.shtml")
hero = wd.find_element(By.XPATH, "//ul[@class='herolist clearfix']/li[5]")
time.sleep(1)
hero.click()
time.sleep(10)

hero = WebDriverWait(wd, 10).until(
    lambda x: x.find_element(By.XPATH, "//ul[@class='herolist clearfix']/li[5]")
)

hero = WebDriverWait(wd, 10).until(
    EC.presence_of_element_located((By.XPATH, "//ul[@class='herolist clearfix']/li[5]"))
)
